package datastructure.stackAndQueue;

public class SomeMethod {
	//���鳤�ȼӱ�
	public void expand(){
		Object[] array = new Object[3];
		Object[] newArray = new Object[2*array.length];
		for(int i=0;i<array.length;i++){
			newArray[i] = array[i];
		}
		array = newArray;
	}
	public void testLQ(){
		LinkedQueue lq = new LinkedQueue();
		lq.clear();
		System.out.println("lq.isEmpty():"+lq.isEmpty());
		System.out.println("lq.size():"+lq.size());
		lq.enqueue("aaa");
		System.out.println("lq"+lq);
		lq.enqueue("bbb");
		System.out.println("lq"+lq);
		lq.enqueue("ccc");
		System.out.println("lq"+lq);
		lq.enqueue("ddd");
		System.out.println("lq"+lq);
		lq.enqueue("eee");
		System.out.println("lq"+lq);
		lq.enqueue("fff");
		System.out.println("lq"+lq);
		System.out.println(lq.dequeue());
		System.out.println(lq.dequeue());
		System.out.println(lq.peek());
		System.out.println(lq);
	}
	
	public static void main(String[] args){
//		ArrayStack stack = new ArrayStack();
//		ArrayQueue stack = new ArrayQueue();
//		stack.enqueue("aaa");
//		stack.enqueue("bbb");
//		stack.enqueue("ccc");
//		stack.enqueue("ddd");
//		stack.enqueue("eee");
//		stack.enqueue("fff");
//		System.out.println("stack size:"+stack.size());
////		System.out.println(stack.peek());
////		System.out.println(stack.pop());
////		System.out.println(stack.peek());
//		System.out.println(stack);
		
		SomeMethod sm = new SomeMethod();
		sm.testLQ();
	}
}
